/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Principal.java
 *
 * Created on 08/03/2011, 09:06:07
 */

package sisgraf.view;
import java.util.List;
import sisgraf.model.Perfil;
import sisgraf.model.Modulo;
import sisgraf.controler.PerfilControler;
import sisgraf.dao.ModuloDaoImp;
/**
 *
 * @author jordan
 */
public class Perfis extends javax.swing.JDialog {
    private int opcao=0;
    private PerfilControler perfilControler;
    private Perfil perfil;
    private boolean incluiu=false;
    /** Creates new form Principal */
    public Perfis(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    public void setOpcao(int opcao)
    {
        this.opcao = opcao;
        formComponentResized(null);
        setLocationRelativeTo(null);
        jTxFdDescricao.setText(perfil.getDescricao());
        if (this.opcao == Menu.OP_PESQ_ALT){
            jTxFdCodigo.setText(perfil.getId().toString());
            ckBxMenuCadastroBasico.setSelected(perfil.getPermissao("cbs", "M"));
            ckBxPesquisaVendedores.setSelected(perfil.getPermissao("vnd", "P"));
            ckBxInclusaoVendedores.setSelected(perfil.getPermissao("vnd", "I"));
            ckBxAlteracaoVendedores.setSelected(perfil.getPermissao("vnd", "A"));
            ckBxExclusaoVendedores.setSelected(perfil.getPermissao("vnd", "E"));
            ckBxPesquisaMaterias.setSelected(perfil.getPermissao("mtr", "P"));
            ckBxInclusaoMaterias.setSelected(perfil.getPermissao("mtr", "I"));
            ckBxAlteracaoMaterias.setSelected(perfil.getPermissao("mtr", "A"));
            ckBxExclusaoMaterias.setSelected(perfil.getPermissao("mtr", "E"));
            ckBxPesquisaClientes.setSelected(perfil.getPermissao("clt", "P"));
            ckBxInclusaoClientes.setSelected(perfil.getPermissao("clt", "I"));
            ckBxAlteracaoClientes.setSelected(perfil.getPermissao("clt", "A"));
            ckBxExclusaoClientes.setSelected(perfil.getPermissao("clt", "E"));

            ckBxPesquisaOrcamentos.setSelected(perfil.getPermissao("orc", "P"));
            ckBxInclusaoOrcamentos.setSelected(perfil.getPermissao("orc", "I"));
            ckBxAlteracaoOrcamentos.setSelected(perfil.getPermissao("orc", "A"));
            ckBxExclusaoOrcamentos.setSelected(perfil.getPermissao("orc", "E"));
            ckBxConsultarOrcamentos.setSelected(perfil.getPermissao("orc", "C"));
            ckBxImprimirOrcamentos.setSelected(perfil.getPermissao("orc", "I"));

            ckBxPesquisaItesOrcamentos.setSelected(perfil.getPermissao("ird", "P"));
            ckBxInclusaoItesOrcamentos.setSelected(perfil.getPermissao("ird", "I"));
            ckBxAlteracaoItesOrcamentos.setSelected(perfil.getPermissao("ird", "A"));
            ckBxExclusaoItesOrcamentos.setSelected(perfil.getPermissao("ird", "E"));
            ckBxAprovarItesOrcamentos.setSelected(perfil.getPermissao("ird", "AP"));
            ckBxCancelarItesOrcamentos.setSelected(perfil.getPermissao("ird", "CA"));

            ckBxPesquisaItesPedido.setSelected(perfil.getPermissao("ped", "P"));
            ckBxAlteracaoPedio.setSelected(perfil.getPermissao("ped", "A"));
            ckBxConsultaPedido.setSelected(perfil.getPermissao("ped", "C"));
            ckBxConcluirPedido.setSelected(perfil.getPermissao("ped", "CC"));
            ckBxFaturarPedido.setSelected(perfil.getPermissao("ped", "FA"));
            ckBxCancelarPedido.setSelected(perfil.getPermissao("ped", "CA"));

            ckBxMenuRalatorios.setSelected(perfil.getPermissao("rel", "M"));
            ckBxFaturamentoRelatorios.setSelected(perfil.getPermissao("rel", "FA"));
            ckBxExtratoRelatorios.setSelected(perfil.getPermissao("rel", "EX"));
            ckBxRankingRelatorios.setSelected(perfil.getPermissao("rel", "RA"));
            ckBxPedidosRelatorios.setSelected(perfil.getPermissao("rel", "PE"));
            ckBxClientesRelatorios.setSelected(perfil.getPermissao("rel", "CL"));

            ckBxMenuControleAcesso.setSelected(perfil.getPermissao("cta", "M"));

            ckBxPesquisaUsuario.setSelected(perfil.getPermissao("usr", "P"));
            ckBxInclusaoUsuario.setSelected(perfil.getPermissao("usr", "I"));
            ckBxAlteracaoUsuario.setSelected(perfil.getPermissao("usr", "A"));
            ckBxConsultarUsuario.setSelected(perfil.getPermissao("usr", "C"));
            ckBxExclusaoUsuario.setSelected(perfil.getPermissao("usr", "E"));
            ckBxSenhaPadraoUsuario.setSelected(perfil.getPermissao("usr", "SP"));

            ckBxPesquisaPerfis.setSelected(perfil.getPermissao("per", "P"));
            ckBxInclusaoPerfis.setSelected(perfil.getPermissao("per", "I"));
            ckBxAlteracaoPerfis.setSelected(perfil.getPermissao("per", "A"));
            ajustaCampos();
        } else {
            jTxFdCodigo.setText("");
            ckBxMenuCadastroBasico.setSelected(false);
            ckBxPesquisaOrcamentos.setSelected(false);
            ckBxPesquisaItesPedido.setSelected(false);
            ckBxMenuRalatorios.setSelected(false);
            ckBxMenuControleAcesso.setSelected(false);
            ajustaCampos();
        }
       
        jTxFdCodigo.setEnabled(false);
        setVisible(true);
        jTxFdDescricao.setFocusable(true);
    }
    public void setPerfil(Perfil perfil){
        this.perfil = perfil;
    }
    public void setControler(PerfilControler perfilControler){
        this.perfilControler = perfilControler;
    }
    public boolean getncluiu(){
        return this.incluiu;
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel4 = new javax.swing.JLabel();
        jPnlSuperior = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jPnlCentral = new javax.swing.JPanel();
        jPnlConteudo = new javax.swing.JPanel();
        rotuloCodigo = new javax.swing.JLabel();
        jTxFdCodigo = new javax.swing.JTextField();
        rotuloDescricao = new javax.swing.JLabel();
        jTxFdDescricao = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        rotuloCadastroBasico = new javax.swing.JLabel();
        ckBxMenuCadastroBasico = new javax.swing.JCheckBox();
        rotuloVendedores = new javax.swing.JLabel();
        ckBxPesquisaVendedores = new javax.swing.JCheckBox();
        ckBxInclusaoVendedores = new javax.swing.JCheckBox();
        ckBxAlteracaoVendedores = new javax.swing.JCheckBox();
        ckBxExclusaoVendedores = new javax.swing.JCheckBox();
        rotuloMaterias = new javax.swing.JLabel();
        ckBxPesquisaMaterias = new javax.swing.JCheckBox();
        ckBxInclusaoMaterias = new javax.swing.JCheckBox();
        ckBxAlteracaoMaterias = new javax.swing.JCheckBox();
        ckBxExclusaoMaterias = new javax.swing.JCheckBox();
        rotuloClientes = new javax.swing.JLabel();
        ckBxPesquisaClientes = new javax.swing.JCheckBox();
        ckBxInclusaoClientes = new javax.swing.JCheckBox();
        ckBxAlteracaoClientes = new javax.swing.JCheckBox();
        ckBxExclusaoClientes = new javax.swing.JCheckBox();
        rotuloOrcamentos = new javax.swing.JLabel();
        ckBxPesquisaOrcamentos = new javax.swing.JCheckBox();
        ckBxInclusaoOrcamentos = new javax.swing.JCheckBox();
        ckBxAlteracaoOrcamentos = new javax.swing.JCheckBox();
        ckBxExclusaoOrcamentos = new javax.swing.JCheckBox();
        ckBxConsultarOrcamentos = new javax.swing.JCheckBox();
        ckBxImprimirOrcamentos = new javax.swing.JCheckBox();
        ckBxCancelarItesOrcamentos = new javax.swing.JCheckBox();
        ckBxAprovarItesOrcamentos = new javax.swing.JCheckBox();
        ckBxExclusaoItesOrcamentos = new javax.swing.JCheckBox();
        ckBxAlteracaoItesOrcamentos = new javax.swing.JCheckBox();
        ckBxInclusaoItesOrcamentos = new javax.swing.JCheckBox();
        ckBxPesquisaItesOrcamentos = new javax.swing.JCheckBox();
        rotuloItesOrcamentos = new javax.swing.JLabel();
        rotuloPedido = new javax.swing.JLabel();
        ckBxPesquisaItesPedido = new javax.swing.JCheckBox();
        ckBxAlteracaoPedio = new javax.swing.JCheckBox();
        ckBxConsultaPedido = new javax.swing.JCheckBox();
        ckBxConcluirPedido = new javax.swing.JCheckBox();
        ckBxFaturarPedido = new javax.swing.JCheckBox();
        ckBxCancelarPedido = new javax.swing.JCheckBox();
        rotuloControleAcesso = new javax.swing.JLabel();
        ckBxMenuControleAcesso = new javax.swing.JCheckBox();
        rotuloRelatorios = new javax.swing.JLabel();
        ckBxMenuRalatorios = new javax.swing.JCheckBox();
        ckBxFaturamentoRelatorios = new javax.swing.JCheckBox();
        ckBxExtratoRelatorios = new javax.swing.JCheckBox();
        ckBxRankingRelatorios = new javax.swing.JCheckBox();
        ckBxPedidosRelatorios = new javax.swing.JCheckBox();
        ckBxClientesRelatorios = new javax.swing.JCheckBox();
        rotuloUsuario = new javax.swing.JLabel();
        ckBxPesquisaUsuario = new javax.swing.JCheckBox();
        ckBxInclusaoUsuario = new javax.swing.JCheckBox();
        ckBxAlteracaoUsuario = new javax.swing.JCheckBox();
        ckBxExclusaoUsuario = new javax.swing.JCheckBox();
        ckBxConsultarUsuario = new javax.swing.JCheckBox();
        ckBxSenhaPadraoUsuario = new javax.swing.JCheckBox();
        rotuloPerfis = new javax.swing.JLabel();
        ckBxPesquisaPerfis = new javax.swing.JCheckBox();
        ckBxInclusaoPerfis = new javax.swing.JCheckBox();
        ckBxAlteracaoPerfis = new javax.swing.JCheckBox();
        jPnlControle = new javax.swing.JPanel();
        jBtConfirmar = new javax.swing.JButton();
        jBtFinalizar = new javax.swing.JButton();
        jPnlInferior = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();

        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel4.setText("Grupo de Estudo PMA Anhanguera");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Inclui Perfis");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
        });

        jPnlSuperior.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("SISTEMA DE ORÇAMENTOS PARA SERVIÇOS GRAFICOS");
        jLabel1.setMinimumSize(new java.awt.Dimension(0, 14));

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("Inclusão de Perfis");
        jLabel2.setMinimumSize(new java.awt.Dimension(0, 14));

        javax.swing.GroupLayout jPnlSuperiorLayout = new javax.swing.GroupLayout(jPnlSuperior);
        jPnlSuperior.setLayout(jPnlSuperiorLayout);
        jPnlSuperiorLayout.setHorizontalGroup(
            jPnlSuperiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 836, Short.MAX_VALUE)
            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 836, Short.MAX_VALUE)
        );
        jPnlSuperiorLayout.setVerticalGroup(
            jPnlSuperiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlSuperiorLayout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPnlCentral.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPnlCentral.setMinimumSize(new java.awt.Dimension(100, 0));

        jPnlConteudo.setBorder(javax.swing.BorderFactory.createLineBorder(null));

        rotuloCodigo.setText("Código:");

        rotuloDescricao.setText("Descrição:");

        jPanel1.setBorder(new javax.swing.border.MatteBorder(null));

        rotuloCadastroBasico.setText("Cadastro Básico");

        ckBxMenuCadastroBasico.setText("Menu");
        ckBxMenuCadastroBasico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxMenuCadastroBasicoActionPerformed(evt);
            }
        });

        rotuloVendedores.setText("Vendedores");

        ckBxPesquisaVendedores.setText("Pesquisa");
        ckBxPesquisaVendedores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaVendedoresActionPerformed(evt);
            }
        });

        ckBxInclusaoVendedores.setText("Inclusão");

        ckBxAlteracaoVendedores.setText("Alteração");

        ckBxExclusaoVendedores.setText("Exclusao");

        rotuloMaterias.setText("Materiais");

        ckBxPesquisaMaterias.setText("Pesquisa");
        ckBxPesquisaMaterias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaMateriasActionPerformed(evt);
            }
        });

        ckBxInclusaoMaterias.setText("Inclusão");

        ckBxAlteracaoMaterias.setText("Alteração");

        ckBxExclusaoMaterias.setText("Exclusao");

        rotuloClientes.setText("Clientes");

        ckBxPesquisaClientes.setText("Pesquisa");
        ckBxPesquisaClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaClientesActionPerformed(evt);
            }
        });

        ckBxInclusaoClientes.setText("Inclusão");

        ckBxAlteracaoClientes.setText("Alteração");

        ckBxExclusaoClientes.setText("Exclusao");

        rotuloOrcamentos.setText("Orçamentos");

        ckBxPesquisaOrcamentos.setText("Pesquisa");
        ckBxPesquisaOrcamentos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaOrcamentosActionPerformed(evt);
            }
        });

        ckBxInclusaoOrcamentos.setText("Inclusão");

        ckBxAlteracaoOrcamentos.setText("Alteração");

        ckBxExclusaoOrcamentos.setText("Exclusao");

        ckBxConsultarOrcamentos.setText("Consultar");

        ckBxImprimirOrcamentos.setText("Imprimir");

        ckBxCancelarItesOrcamentos.setText("Cancelar");

        ckBxAprovarItesOrcamentos.setText("Aprovar");

        ckBxExclusaoItesOrcamentos.setText("Exclusao");

        ckBxAlteracaoItesOrcamentos.setText("Alteração");

        ckBxInclusaoItesOrcamentos.setText("Inclusão");

        ckBxPesquisaItesOrcamentos.setText("Pesquisa");
        ckBxPesquisaItesOrcamentos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaItesOrcamentosActionPerformed(evt);
            }
        });

        rotuloItesOrcamentos.setText("Itens Orçamento");

        rotuloPedido.setText("Pedido");

        ckBxPesquisaItesPedido.setText("Pesquisa");
        ckBxPesquisaItesPedido.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaItesPedidoActionPerformed(evt);
            }
        });

        ckBxAlteracaoPedio.setText("Alteração");

        ckBxConsultaPedido.setText("Consulta");

        ckBxConcluirPedido.setText("Concluir");

        ckBxFaturarPedido.setText("Faturar");

        ckBxCancelarPedido.setText("Cancelar");

        rotuloControleAcesso.setText("Controle de Acesso");

        ckBxMenuControleAcesso.setText("Menu");
        ckBxMenuControleAcesso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxMenuControleAcessoActionPerformed(evt);
            }
        });

        rotuloRelatorios.setText("Relatórios");

        ckBxMenuRalatorios.setText("Menu");
        ckBxMenuRalatorios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxMenuRalatoriosActionPerformed(evt);
            }
        });

        ckBxFaturamentoRelatorios.setText("Faturamento");

        ckBxExtratoRelatorios.setText("Extrato");

        ckBxRankingRelatorios.setText("Ranking");

        ckBxPedidosRelatorios.setText("Pedidos");

        ckBxClientesRelatorios.setText("Clientes");

        rotuloUsuario.setText("Usuário");

        ckBxPesquisaUsuario.setText("Pesquisa");
        ckBxPesquisaUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaUsuarioActionPerformed(evt);
            }
        });

        ckBxInclusaoUsuario.setText("Inclusão");

        ckBxAlteracaoUsuario.setText("Alteração");

        ckBxExclusaoUsuario.setText("Exclusao");

        ckBxConsultarUsuario.setText("Desativar");

        ckBxSenhaPadraoUsuario.setText("Senha Padrão");

        rotuloPerfis.setText("Perfis");

        ckBxPesquisaPerfis.setText("Pesquisa");
        ckBxPesquisaPerfis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ckBxPesquisaPerfisActionPerformed(evt);
            }
        });

        ckBxInclusaoPerfis.setText("Inclusão");

        ckBxAlteracaoPerfis.setText("Alteração");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rotuloControleAcesso)
                            .addComponent(rotuloUsuario)
                            .addComponent(rotuloPerfis))
                        .addGap(20, 20, 20)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxPesquisaUsuario)
                                    .addComponent(ckBxPesquisaPerfis))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxInclusaoUsuario)
                                    .addComponent(ckBxInclusaoPerfis))
                                .addGap(29, 29, 29)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxAlteracaoUsuario)
                                    .addComponent(ckBxAlteracaoPerfis))
                                .addGap(45, 45, 45)
                                .addComponent(ckBxExclusaoUsuario)
                                .addGap(27, 27, 27)
                                .addComponent(ckBxConsultarUsuario)
                                .addGap(30, 30, 30)
                                .addComponent(ckBxSenhaPadraoUsuario))
                            .addComponent(ckBxMenuControleAcesso)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rotuloPedido)
                            .addComponent(rotuloItesOrcamentos)
                            .addComponent(rotuloOrcamentos)
                            .addComponent(rotuloClientes)
                            .addComponent(rotuloMaterias)
                            .addComponent(rotuloVendedores)
                            .addComponent(rotuloCadastroBasico)
                            .addComponent(rotuloRelatorios))
                        .addGap(32, 32, 32)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxPesquisaVendedores)
                                    .addComponent(ckBxPesquisaMaterias))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxInclusaoVendedores)
                                    .addComponent(ckBxInclusaoMaterias))
                                .addGap(35, 35, 35)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxAlteracaoMaterias)
                                    .addComponent(ckBxAlteracaoVendedores))
                                .addGap(45, 45, 45)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxExclusaoVendedores)
                                    .addComponent(ckBxExclusaoMaterias)))
                            .addComponent(ckBxMenuCadastroBasico)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxPesquisaClientes)
                                    .addComponent(ckBxPesquisaOrcamentos)
                                    .addComponent(ckBxPesquisaItesOrcamentos))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxInclusaoClientes)
                                    .addComponent(ckBxInclusaoOrcamentos)
                                    .addComponent(ckBxInclusaoItesOrcamentos))
                                .addGap(35, 35, 35)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxAlteracaoItesOrcamentos)
                                    .addComponent(ckBxAlteracaoOrcamentos)
                                    .addComponent(ckBxAlteracaoClientes))
                                .addGap(45, 45, 45)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(ckBxExclusaoOrcamentos)
                                            .addComponent(ckBxExclusaoItesOrcamentos))
                                        .addGap(27, 27, 27)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(ckBxConsultarOrcamentos)
                                            .addComponent(ckBxAprovarItesOrcamentos)
                                            .addComponent(ckBxFaturarPedido)
                                            .addComponent(ckBxPedidosRelatorios))
                                        .addGap(30, 30, 30)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(ckBxCancelarItesOrcamentos)
                                            .addComponent(ckBxImprimirOrcamentos)))
                                    .addComponent(ckBxExclusaoClientes)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(ckBxMenuRalatorios)
                                        .addGap(31, 31, 31)
                                        .addComponent(ckBxFaturamentoRelatorios))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(ckBxPesquisaItesPedido)
                                        .addGap(18, 18, 18)
                                        .addComponent(ckBxAlteracaoPedio)))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxConsultaPedido)
                                    .addComponent(ckBxExtratoRelatorios))
                                .addGap(48, 48, 48)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxConcluirPedido)
                                    .addComponent(ckBxRankingRelatorios))
                                .addGap(131, 131, 131)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ckBxClientesRelatorios)
                                    .addComponent(ckBxCancelarPedido))))))
                .addContainerGap(104, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ckBxMenuCadastroBasico)
                    .addComponent(rotuloCadastroBasico))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ckBxPesquisaVendedores)
                    .addComponent(ckBxInclusaoVendedores, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxAlteracaoVendedores, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxExclusaoVendedores)
                    .addComponent(rotuloVendedores, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ckBxPesquisaMaterias)
                    .addComponent(ckBxInclusaoMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxAlteracaoMaterias, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxExclusaoMaterias)
                    .addComponent(rotuloMaterias))
                .addGap(3, 3, 3)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ckBxPesquisaClientes)
                    .addComponent(ckBxInclusaoClientes, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxAlteracaoClientes, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxExclusaoClientes)
                    .addComponent(rotuloClientes))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ckBxPesquisaOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxInclusaoOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxAlteracaoOrcamentos)
                    .addComponent(ckBxExclusaoOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxConsultarOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxImprimirOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rotuloOrcamentos))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ckBxPesquisaItesOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxInclusaoItesOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxAlteracaoItesOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxExclusaoItesOrcamentos)
                    .addComponent(ckBxAprovarItesOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ckBxCancelarItesOrcamentos, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rotuloItesOrcamentos))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxPesquisaItesPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ckBxAlteracaoPedio)
                            .addComponent(rotuloPedido)
                            .addComponent(ckBxConsultaPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxConcluirPedido)
                            .addComponent(ckBxFaturarPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(ckBxCancelarPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(7, 7, 7)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(7, 7, 7)
                                .addComponent(rotuloRelatorios))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(ckBxMenuRalatorios)
                                    .addComponent(ckBxClientesRelatorios)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(ckBxFaturamentoRelatorios)
                                        .addComponent(ckBxExtratoRelatorios)))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxMenuControleAcesso)
                            .addComponent(rotuloControleAcesso)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxRankingRelatorios)
                            .addComponent(ckBxPedidosRelatorios))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(rotuloUsuario)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rotuloPerfis))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxPesquisaUsuario)
                            .addComponent(ckBxInclusaoUsuario))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxPesquisaPerfis)
                            .addComponent(ckBxInclusaoPerfis)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ckBxExclusaoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ckBxConsultarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ckBxSenhaPadraoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ckBxAlteracaoUsuario))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ckBxAlteracaoPerfis)))
                .addContainerGap(67, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPnlConteudoLayout = new javax.swing.GroupLayout(jPnlConteudo);
        jPnlConteudo.setLayout(jPnlConteudoLayout);
        jPnlConteudoLayout.setHorizontalGroup(
            jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlConteudoLayout.createSequentialGroup()
                .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPnlConteudoLayout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addComponent(rotuloCodigo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTxFdCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(rotuloDescricao)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTxFdDescricao, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE))
                    .addGroup(jPnlConteudoLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPnlConteudoLayout.setVerticalGroup(
            jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlConteudoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPnlConteudoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rotuloCodigo)
                    .addComponent(jTxFdCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rotuloDescricao)
                    .addComponent(jTxFdDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPnlControle.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jBtConfirmar.setText("Confirmar");
        jBtConfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtConfirmarActionPerformed(evt);
            }
        });

        jBtFinalizar.setText("Finalizar");
        jBtFinalizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtFinalizarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPnlControleLayout = new javax.swing.GroupLayout(jPnlControle);
        jPnlControle.setLayout(jPnlControleLayout);
        jPnlControleLayout.setHorizontalGroup(
            jPnlControleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPnlControleLayout.createSequentialGroup()
                .addContainerGap(662, Short.MAX_VALUE)
                .addComponent(jBtConfirmar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBtFinalizar)
                .addContainerGap())
        );
        jPnlControleLayout.setVerticalGroup(
            jPnlControleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPnlControleLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPnlControleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtFinalizar)
                    .addComponent(jBtConfirmar))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPnlCentralLayout = new javax.swing.GroupLayout(jPnlCentral);
        jPnlCentral.setLayout(jPnlCentralLayout);
        jPnlCentralLayout.setHorizontalGroup(
            jPnlCentralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPnlControle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPnlConteudo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPnlCentralLayout.setVerticalGroup(
            jPnlCentralLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPnlCentralLayout.createSequentialGroup()
                .addComponent(jPnlConteudo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPnlControle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPnlInferior.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel3.setText("Gráfica Modêlo");

        javax.swing.GroupLayout jPnlInferiorLayout = new javax.swing.GroupLayout(jPnlInferior);
        jPnlInferior.setLayout(jPnlInferiorLayout);
        jPnlInferiorLayout.setHorizontalGroup(
            jPnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPnlInferiorLayout.createSequentialGroup()
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(724, Short.MAX_VALUE))
        );
        jPnlInferiorLayout.setVerticalGroup(
            jPnlInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel3)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPnlSuperior, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPnlCentral, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPnlInferior, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPnlSuperior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPnlCentral, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPnlInferior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
        // TODO add your handling code here:
        int dif = this.getHeight()-jPnlSuperior.getHeight()-jPnlCentral.getHeight()-jPnlInferior.getHeight()-6;
        jPnlCentral.setSize(this.getWidth(),this.getHeight()-jPnlSuperior.getHeight()-jPnlInferior.getHeight()-dif);
        jPnlConteudo.setSize(jPnlCentral.getWidth(),jPnlCentral.getHeight()-jPnlControle.getHeight());
        jPnlControle.setSize(jPnlCentral.getWidth(), jPnlControle.getHeight());
        jPnlControle.setLocation(0, jPnlConteudo.getHeight());
    }//GEN-LAST:event_formComponentResized

    private void jBtFinalizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtFinalizarActionPerformed
        // TODO add your handling code here:
        String dbDescricao=perfil.getDescricao()==null?"":perfil.getDescricao();
        if (!jTxFdDescricao.getText().equals(dbDescricao)
                ){
            if (javax.swing.JOptionPane.showConfirmDialog(null,
                    "Modificações foram feitas, deseja realmente finalizar sem salvar ?",
                    "Finalizar", javax.swing.JOptionPane.YES_NO_OPTION)==0){
               Perfis.this.dispose();
            }
        } else Perfis.this.dispose();

    }//GEN-LAST:event_jBtFinalizarActionPerformed

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        // TODO add your handling code here:
        perfilControler.liberarPerfil();

    }//GEN-LAST:event_formWindowClosed

    private void jBtConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtConfirmarActionPerformed
        // TODO add your handling code here:
        boolean gravarOk = true;
        String mensErro="Dados não puderam ser salvos, apresentaram os seguintes erro:";
        if (jTxFdDescricao==null||jTxFdDescricao.getText().equals("")){
            gravarOk=false;
            mensErro+="\nO campo descrição deve ser preenchido";
        }
        if (!gravarOk){
           javax.swing.JOptionPane.showMessageDialog(null,
                   mensErro+"\n"
                   + "Corrija as infromações listadas e tente confirmar novamente ",
                   "Acesso ao Banco de Dados", javax.swing.JOptionPane.INFORMATION_MESSAGE);
        } else {
            perfil.setDescricao(jTxFdDescricao.getText());
            if (this.opcao == Menu.OP_PESQ_ALT){
               perfil.setPermissao("cbs", "M", ckBxMenuCadastroBasico.isSelected());
               perfil.setPermissao("vnd", "P", ckBxPesquisaVendedores.isSelected());
               perfil.setPermissao("vnd", "I", ckBxInclusaoVendedores.isSelected());
               perfil.setPermissao("vnd", "A", ckBxAlteracaoVendedores.isSelected());
               perfil.setPermissao("vnd", "E", ckBxExclusaoVendedores.isSelected());
               perfil.setPermissao("mtr", "P", ckBxPesquisaMaterias.isSelected());
               perfil.setPermissao("mtr", "I", ckBxInclusaoMaterias.isSelected());
               perfil.setPermissao("mtr", "A", ckBxAlteracaoMaterias.isSelected());
               perfil.setPermissao("mtr", "E", ckBxExclusaoMaterias.isSelected());
               perfil.setPermissao("clt", "P", ckBxPesquisaClientes.isSelected());
               perfil.setPermissao("clt", "I", ckBxInclusaoClientes.isSelected());
               perfil.setPermissao("clt", "A", ckBxAlteracaoClientes.isSelected());
               perfil.setPermissao("clt", "E", ckBxExclusaoClientes.isSelected());

               perfil.setPermissao("orc", "P", ckBxPesquisaOrcamentos.isSelected());
               perfil.setPermissao("orc", "I", ckBxInclusaoOrcamentos.isSelected());
               perfil.setPermissao("orc", "A", ckBxAlteracaoOrcamentos.isSelected());
               perfil.setPermissao("orc", "E", ckBxExclusaoOrcamentos.isSelected());
               perfil.setPermissao("orc", "C", ckBxConsultarOrcamentos.isSelected());
               perfil.setPermissao("orc", "I", ckBxImprimirOrcamentos.isSelected());

               perfil.setPermissao("ird", "P", ckBxPesquisaItesOrcamentos.isSelected());
               perfil.setPermissao("ird", "I", ckBxInclusaoItesOrcamentos.isSelected());
               perfil.setPermissao("ird", "A", ckBxAlteracaoItesOrcamentos.isSelected());
               perfil.setPermissao("ird", "E", ckBxExclusaoItesOrcamentos.isSelected());
               perfil.setPermissao("ird", "AP", ckBxAprovarItesOrcamentos.isSelected());
               perfil.setPermissao("ird", "CA", ckBxCancelarItesOrcamentos.isSelected());

               perfil.setPermissao("ped", "P", ckBxPesquisaItesPedido.isSelected());
               perfil.setPermissao("ped", "A", ckBxAlteracaoPedio.isSelected());
               perfil.setPermissao("ped", "C", ckBxConsultaPedido.isSelected());
               perfil.setPermissao("ped", "CC", ckBxConcluirPedido.isSelected());
               perfil.setPermissao("ped", "FA", ckBxFaturarPedido.isSelected());
               perfil.setPermissao("ped", "CA", ckBxCancelarPedido.isSelected());

               perfil.setPermissao("rel", "M", ckBxMenuRalatorios.isSelected());
               perfil.setPermissao("rel", "FA", ckBxFaturamentoRelatorios.isSelected());
               perfil.setPermissao("rel", "EX", ckBxExtratoRelatorios.isSelected());
               perfil.setPermissao("rel", "RA", ckBxRankingRelatorios.isSelected());
               perfil.setPermissao("rel", "PE", ckBxPedidosRelatorios.isSelected());
               perfil.setPermissao("rel", "CL", ckBxClientesRelatorios.isSelected());

               perfil.setPermissao("cta", "M", ckBxMenuControleAcesso.isSelected());

               perfil.setPermissao("usr", "P", ckBxPesquisaUsuario.isSelected());
               perfil.setPermissao("usr", "I", ckBxInclusaoUsuario.isSelected());
               perfil.setPermissao("usr", "A", ckBxAlteracaoUsuario.isSelected());
               perfil.setPermissao("usr", "C", ckBxConsultarUsuario.isSelected());
               perfil.setPermissao("usr", "E", ckBxExclusaoUsuario.isSelected());
               perfil.setPermissao("usr", "SP", ckBxSenhaPadraoUsuario.isSelected());

               perfil.setPermissao("per", "P", ckBxPesquisaPerfis.isSelected());
               perfil.setPermissao("per", "I", ckBxInclusaoPerfis.isSelected());
               perfil.setPermissao("per", "A", ckBxAlteracaoPerfis.isSelected());
               
               if (!perfilControler.alterarPerfil(perfil)){
                  javax.swing.JOptionPane.showMessageDialog(null,
                    "Erro na atualização dos dados do perfil",
                    "Acesso ao Banco de Dados",
                    javax.swing.JOptionPane.INFORMATION_MESSAGE);
                }
            } else if (this.opcao == Menu.OP_PESQ_INC){
                //Modulo mod = new Modulo();
                //List<Modulo> lista = new ModuloDaoImp().list("");
           
                boolean teste=perfilControler.adicionarPerfil(perfil);
                if (!teste){
                    javax.swing.JOptionPane.showMessageDialog(null,
                        "Erro na inclusão do Perfil",
                        "Acesso ao Banco de Dados",
                        javax.swing.JOptionPane.INFORMATION_MESSAGE);
                } this.incluiu = true;
            }
            Perfis.this.dispose();
        }

    }//GEN-LAST:event_jBtConfirmarActionPerformed

    private void ckBxMenuCadastroBasicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxMenuCadastroBasicoActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
}//GEN-LAST:event_ckBxMenuCadastroBasicoActionPerformed

    private void ckBxPesquisaVendedoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaVendedoresActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaVendedoresActionPerformed

    private void ckBxPesquisaMateriasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaMateriasActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaMateriasActionPerformed

    private void ckBxPesquisaClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaClientesActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaClientesActionPerformed

    private void ckBxPesquisaOrcamentosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaOrcamentosActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaOrcamentosActionPerformed

    private void ckBxPesquisaItesOrcamentosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaItesOrcamentosActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaItesOrcamentosActionPerformed

    private void ckBxPesquisaItesPedidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaItesPedidoActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaItesPedidoActionPerformed

    private void ckBxMenuRalatoriosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxMenuRalatoriosActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxMenuRalatoriosActionPerformed

    private void ckBxMenuControleAcessoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxMenuControleAcessoActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxMenuControleAcessoActionPerformed

    private void ckBxPesquisaUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaUsuarioActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaUsuarioActionPerformed

    private void ckBxPesquisaPerfisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ckBxPesquisaPerfisActionPerformed
        // TODO add your handling code here:
        ajustaCampos();
    }//GEN-LAST:event_ckBxPesquisaPerfisActionPerformed
    private void ajustaCampos(){
        if (!ckBxMenuCadastroBasico.isSelected()){
            ckBxPesquisaVendedores.setSelected(false);
            ckBxPesquisaVendedores.setEnabled(false);
            ckBxPesquisaMaterias.setSelected(false);
            ckBxPesquisaMaterias.setEnabled(false);
            ckBxPesquisaClientes.setSelected(false);
            ckBxPesquisaClientes.setEnabled(false);
        } else {
            ckBxPesquisaMaterias.setEnabled(true);
            ckBxPesquisaVendedores.setEnabled(true);
            ckBxPesquisaClientes.setEnabled(true);
        };
        if (!ckBxPesquisaVendedores.isSelected()){
            ckBxInclusaoVendedores.setSelected(false);
            ckBxAlteracaoVendedores.setSelected(false);
            ckBxExclusaoVendedores.setSelected(false);
            ckBxInclusaoVendedores.setEnabled(false);
            ckBxAlteracaoVendedores.setEnabled(false);
            ckBxExclusaoVendedores.setEnabled(false);

        } else {
            ckBxInclusaoVendedores.setEnabled(true);
            ckBxAlteracaoVendedores.setEnabled(true);
            ckBxExclusaoVendedores.setEnabled(true);
        }
        if (!ckBxPesquisaMaterias.isSelected()){
            ckBxInclusaoMaterias.setSelected(false);
            ckBxAlteracaoMaterias.setSelected(false);
            ckBxExclusaoMaterias.setSelected(false);
            ckBxInclusaoMaterias.setEnabled(false);
            ckBxAlteracaoMaterias.setEnabled(false);
            ckBxExclusaoMaterias.setEnabled(false);
        } else {
            ckBxInclusaoMaterias.setEnabled(true);
            ckBxAlteracaoMaterias.setEnabled(true);
            ckBxExclusaoMaterias.setEnabled(true);
        }
        if (!ckBxPesquisaClientes.isSelected()){
            ckBxInclusaoClientes.setSelected(false);
            ckBxAlteracaoClientes.setSelected(false);
            ckBxExclusaoClientes.setSelected(false);
            ckBxInclusaoClientes.setEnabled(false);
            ckBxAlteracaoClientes.setEnabled(false);
            ckBxExclusaoClientes.setEnabled(false);
        } else {
            ckBxInclusaoClientes.setEnabled(true);
            ckBxAlteracaoClientes.setEnabled(true);
            ckBxExclusaoClientes.setEnabled(true);
        }
        if (!ckBxPesquisaOrcamentos.isSelected()){
            ckBxInclusaoOrcamentos.setSelected(false);
            ckBxAlteracaoOrcamentos.setSelected(false);
            ckBxExclusaoOrcamentos.setSelected(false);
            ckBxConsultarOrcamentos.setSelected(false);
            ckBxImprimirOrcamentos.setSelected(false);
            ckBxInclusaoOrcamentos.setEnabled(false);
            ckBxAlteracaoOrcamentos.setEnabled(false);
            ckBxExclusaoOrcamentos.setEnabled(false);
            ckBxConsultarOrcamentos.setEnabled(false);
            ckBxImprimirOrcamentos.setEnabled(false);
        } else {
            ckBxInclusaoOrcamentos.setEnabled(true);
            ckBxAlteracaoOrcamentos.setEnabled(true);
            ckBxExclusaoOrcamentos.setEnabled(true);
            ckBxConsultarOrcamentos.setEnabled(true);
            ckBxImprimirOrcamentos.setEnabled(true);
        }
        if (!ckBxPesquisaItesOrcamentos.isSelected()){
            ckBxInclusaoItesOrcamentos.setSelected(false);
            ckBxAlteracaoItesOrcamentos.setSelected(false);
            ckBxExclusaoItesOrcamentos.setSelected(false);
            ckBxAprovarItesOrcamentos.setSelected(false);
            ckBxCancelarItesOrcamentos.setSelected(false);
            ckBxInclusaoItesOrcamentos.setEnabled(false);
            ckBxAlteracaoItesOrcamentos.setEnabled(false);
            ckBxExclusaoItesOrcamentos.setEnabled(false);
            ckBxAprovarItesOrcamentos.setEnabled(false);
            ckBxCancelarItesOrcamentos.setEnabled(false);
        } else {
            ckBxInclusaoItesOrcamentos.setEnabled(true);
            ckBxAlteracaoItesOrcamentos.setEnabled(true);
            ckBxExclusaoItesOrcamentos.setEnabled(true);
            ckBxAprovarItesOrcamentos.setEnabled(true);
            ckBxCancelarItesOrcamentos.setEnabled(true);
        }
        if (!ckBxPesquisaItesPedido.isSelected()){
            ckBxAlteracaoPedio.setSelected(false);
            ckBxConsultaPedido.setSelected(false);
            ckBxCancelarPedido.setSelected(false);
            ckBxConcluirPedido.setSelected(false);
            ckBxFaturarPedido.setSelected(false);
            ckBxAlteracaoPedio.setEnabled(false);
            ckBxCancelarPedido.setEnabled(false);
            ckBxConcluirPedido.setEnabled(false);
            ckBxConsultaPedido.setEnabled(false);
            ckBxFaturarPedido.setEnabled(false);
        } else {
            ckBxAlteracaoPedio.setEnabled(true);
            ckBxCancelarPedido.setEnabled(true);
            ckBxConcluirPedido.setEnabled(true);
            ckBxConsultaPedido.setEnabled(true);
            ckBxFaturarPedido.setEnabled(true);
        }
        if (!ckBxMenuRalatorios.isSelected()){
            ckBxPedidosRelatorios.setSelected(false);
            ckBxClientesRelatorios.setSelected(false);
            ckBxExtratoRelatorios.setSelected(false);
            ckBxFaturamentoRelatorios.setSelected(false);
            ckBxRankingRelatorios.setSelected(false);
            ckBxPedidosRelatorios.setEnabled(false);
            ckBxClientesRelatorios.setEnabled(false);
            ckBxExtratoRelatorios.setEnabled(false);
            ckBxFaturamentoRelatorios.setEnabled(false);
            ckBxRankingRelatorios.setEnabled(false);
        } else {
            ckBxPedidosRelatorios.setEnabled(true);
            ckBxClientesRelatorios.setEnabled(true);
            ckBxExtratoRelatorios.setEnabled(true);
            ckBxFaturamentoRelatorios.setEnabled(true);
            ckBxRankingRelatorios.setEnabled(true);
        }
        if (!ckBxMenuControleAcesso.isSelected()){
            ckBxPesquisaUsuario.setSelected(false);
            ckBxPesquisaPerfis.setSelected(false);
            ckBxPesquisaUsuario.setEnabled(false);
            ckBxPesquisaPerfis.setEnabled(false);
        } else {
            ckBxPesquisaUsuario.setEnabled(true);
            ckBxPesquisaPerfis.setEnabled(true);
        }
        if (!ckBxPesquisaUsuario.isSelected()){
            ckBxInclusaoUsuario.setSelected(false);
            ckBxAlteracaoUsuario.setSelected(false);
            ckBxConsultarUsuario.setSelected(false);
            ckBxExclusaoUsuario.setSelected(false);
            ckBxSenhaPadraoUsuario.setSelected(false);
            ckBxInclusaoUsuario.setEnabled(false);
            ckBxAlteracaoUsuario.setEnabled(false);
            ckBxConsultarUsuario.setEnabled(false);
            ckBxExclusaoUsuario.setEnabled(false);
            ckBxSenhaPadraoUsuario.setEnabled(false);
        } else {
            ckBxInclusaoUsuario.setEnabled(true);
            ckBxAlteracaoUsuario.setEnabled(true);
            ckBxConsultarUsuario.setEnabled(true);
            ckBxExclusaoUsuario.setEnabled(true);
            ckBxSenhaPadraoUsuario.setEnabled(true);
        }
        if (!ckBxPesquisaPerfis.isSelected()){
            ckBxInclusaoPerfis.setSelected(false);
            ckBxAlteracaoPerfis.setSelected(false);
            ckBxInclusaoPerfis.setEnabled(false);
            ckBxAlteracaoPerfis.setEnabled(false);
        } else {
            ckBxInclusaoPerfis.setEnabled(true);
            ckBxAlteracaoPerfis.setEnabled(true);
        }
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                Principal dialog = new Principal(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox ckBxAlteracaoClientes;
    private javax.swing.JCheckBox ckBxAlteracaoItesOrcamentos;
    private javax.swing.JCheckBox ckBxAlteracaoMaterias;
    private javax.swing.JCheckBox ckBxAlteracaoOrcamentos;
    private javax.swing.JCheckBox ckBxAlteracaoPedio;
    private javax.swing.JCheckBox ckBxAlteracaoPerfis;
    private javax.swing.JCheckBox ckBxAlteracaoUsuario;
    private javax.swing.JCheckBox ckBxAlteracaoVendedores;
    private javax.swing.JCheckBox ckBxAprovarItesOrcamentos;
    private javax.swing.JCheckBox ckBxCancelarItesOrcamentos;
    private javax.swing.JCheckBox ckBxCancelarPedido;
    private javax.swing.JCheckBox ckBxClientesRelatorios;
    private javax.swing.JCheckBox ckBxConcluirPedido;
    private javax.swing.JCheckBox ckBxConsultaPedido;
    private javax.swing.JCheckBox ckBxConsultarOrcamentos;
    private javax.swing.JCheckBox ckBxConsultarUsuario;
    private javax.swing.JCheckBox ckBxExclusaoClientes;
    private javax.swing.JCheckBox ckBxExclusaoItesOrcamentos;
    private javax.swing.JCheckBox ckBxExclusaoMaterias;
    private javax.swing.JCheckBox ckBxExclusaoOrcamentos;
    private javax.swing.JCheckBox ckBxExclusaoUsuario;
    private javax.swing.JCheckBox ckBxExclusaoVendedores;
    private javax.swing.JCheckBox ckBxExtratoRelatorios;
    private javax.swing.JCheckBox ckBxFaturamentoRelatorios;
    private javax.swing.JCheckBox ckBxFaturarPedido;
    private javax.swing.JCheckBox ckBxImprimirOrcamentos;
    private javax.swing.JCheckBox ckBxInclusaoClientes;
    private javax.swing.JCheckBox ckBxInclusaoItesOrcamentos;
    private javax.swing.JCheckBox ckBxInclusaoMaterias;
    private javax.swing.JCheckBox ckBxInclusaoOrcamentos;
    private javax.swing.JCheckBox ckBxInclusaoPerfis;
    private javax.swing.JCheckBox ckBxInclusaoUsuario;
    private javax.swing.JCheckBox ckBxInclusaoVendedores;
    private javax.swing.JCheckBox ckBxMenuCadastroBasico;
    private javax.swing.JCheckBox ckBxMenuControleAcesso;
    private javax.swing.JCheckBox ckBxMenuRalatorios;
    private javax.swing.JCheckBox ckBxPedidosRelatorios;
    private javax.swing.JCheckBox ckBxPesquisaClientes;
    private javax.swing.JCheckBox ckBxPesquisaItesOrcamentos;
    private javax.swing.JCheckBox ckBxPesquisaItesPedido;
    private javax.swing.JCheckBox ckBxPesquisaMaterias;
    private javax.swing.JCheckBox ckBxPesquisaOrcamentos;
    private javax.swing.JCheckBox ckBxPesquisaPerfis;
    private javax.swing.JCheckBox ckBxPesquisaUsuario;
    private javax.swing.JCheckBox ckBxPesquisaVendedores;
    private javax.swing.JCheckBox ckBxRankingRelatorios;
    private javax.swing.JCheckBox ckBxSenhaPadraoUsuario;
    private javax.swing.JButton jBtConfirmar;
    private javax.swing.JButton jBtFinalizar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPnlCentral;
    private javax.swing.JPanel jPnlConteudo;
    private javax.swing.JPanel jPnlControle;
    private javax.swing.JPanel jPnlInferior;
    private javax.swing.JPanel jPnlSuperior;
    private javax.swing.JTextField jTxFdCodigo;
    private javax.swing.JTextField jTxFdDescricao;
    private javax.swing.JLabel rotuloCadastroBasico;
    private javax.swing.JLabel rotuloClientes;
    private javax.swing.JLabel rotuloCodigo;
    private javax.swing.JLabel rotuloControleAcesso;
    private javax.swing.JLabel rotuloDescricao;
    private javax.swing.JLabel rotuloItesOrcamentos;
    private javax.swing.JLabel rotuloMaterias;
    private javax.swing.JLabel rotuloOrcamentos;
    private javax.swing.JLabel rotuloPedido;
    private javax.swing.JLabel rotuloPerfis;
    private javax.swing.JLabel rotuloRelatorios;
    private javax.swing.JLabel rotuloUsuario;
    private javax.swing.JLabel rotuloVendedores;
    // End of variables declaration//GEN-END:variables
    
}
